import request from '../../request/request.js'
Page({
  data: {
    active: 0,
    albumList:[],
    placeList:[],
    equipList:[]
  },

  onLoad: function(option){
    console.log('onLoad');
    
    this.getAlbumList();
  },
  onChange(event) {
    wx.showToast({
      title: `切换到 ${event.detail.name}`,
      icon: 'none',
    });
  },
  getAlbumList(){
    var that = this
    request({
      url:'system/album/list'
    }).then(res=>{
      this.setData({
        albumList:res.data.data
      })
      let place = this.data.albumList.filter(item=>item.category=='门店环境')
      this.setData({
        placeList:place
      })
      let equip = this.data.albumList.filter(item=>item.category=='健身器材')
      this.setData({
        equipList:equip
      })

    }).catch(err=>{})
  }
});